package io.xxx.mario.task.receive;

import io.xxx.mario.task.SelectMode;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

@Component
public class ReceiverSelectorFactory {

    @Resource
    private SystemReceiverSelector systemReceiverSelector;

    @Resource
    private FileReceiverSelector fileReceiverSelector;

    @Resource
    private ExternalReceiverSelector externalReceiverSelector;

    public ReceiverSelector getSelector(SelectMode selectMode) {
        return switch (selectMode) {
            case SYSTEM -> systemReceiverSelector;
            case FILE -> fileReceiverSelector;
            case EXTERNAL -> externalReceiverSelector;
        };
    }
}
